fix: Keep track of synthetic apify-default-dataset-item events#814
fix: Keep track of synthetic apify-default-dataset-item events#814Mantisus wants to merge 10 commits intoapify:masterfrom
Conversation
Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
|
FYI - apify/apify-sdk-js#570 - this should not be a problem in the Python version, but please make sure. |
Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
| """Context manager to acquire the charge lock if PPE charging manager is active.""" | ||
| charging_manager = charging_manager_ctx.get() | ||
| if charging_manager: | ||
| if charging_manager.charge_lock.locked(): |
There was a problem hiding this comment.
Hmm, asyncio.Lock.locked() tells whether any coroutine currently holds the lock. Doesn't that mean we would skip acquiring the lock and run unsynchronized? That would defeat the purpose of the lock in the first place. Am I missing something?
There was a problem hiding this comment.
When Actor.push_data is called, a lock is set, and Dataset.push_data is called inside it, which leads to this internal lock. Without this check, it will cause a deadlock; the flow will wait for the lock to be unlocked, which itself is blocked.
When calling Dataset.push_data directly, the lock will be set as usual.
vdusek
left a comment
There was a problem hiding this comment.
My last comments were sent. Could you @janbuchar now please check it as well?
Description
_DatasetClientPPEMixinto dataset storage clients to automatically charge for the syntheticapify-default-dataset-itemevent on every push to the default dataset.Actor.push_data()to account for the combined explicit + synthetic event price when enforcing budget limits.Issues
Testing